#include <cstdio>
#include <string>
#include <map>
#define MAX 105

using namespace std;
int main() {
	
	map<string,int> m;
	int N,big = 0;
	scanf("%d",&N);
	char in[MAX], out[MAX];
	getchar();
	for (int i = 0; i < N; i++)
	{
		scanf("%s",in);
		m[in]++;
		if (m[in] > big)
		{
			big = m[in];
			strcpy(out, in);
		}
	}
	puts(out);
	return 0;
}